import request from '@/config/axios'

// 司机银行账号 VO
export interface DriverBankVO {
  id: number // ID
  driverIdCardNo: string // 司机身份证号码
  payeeName: string // 收款人名字
  bankCode: string // 开户银行编码
  bankName: string // 开户银行
  bankBranchName: string // 开户支行
  bankAccountNo: string // 银行账号
  bankAccountName: string // 开户名/开户单位
  deptId: number // 机构ID
}

// 司机银行账号 API
export const DriverBankApi = {
  // 查询司机银行账号分页
  getDriverBankPage: async (params: any) => {
    return await request.get({ url: `/base/driver-bank/page`, params })
  },

  // 查询司机银行账号详情
  getDriverBank: async (id: number) => {
    return await request.get({ url: `/base/driver-bank/get?id=` + id })
  },

  // 新增司机银行账号
  createDriverBank: async (data: DriverBankVO) => {
    return await request.post({ url: `/base/driver-bank/create`, data })
  },

  // 修改司机银行账号
  updateDriverBank: async (data: DriverBankVO) => {
    return await request.put({ url: `/base/driver-bank/update`, data })
  },

  // 删除司机银行账号
  deleteDriverBank: async (id: number) => {
    return await request.delete({ url: `/base/driver-bank/delete?id=` + id })
  },

  // 批量删除司机银行账号
  deleteDriverBanks: async (ids: string) => {
    return await request.delete({ url: `/base/driver-bank/deletes?ids=` + ids })
  },

  // 导出司机银行账号 Excel
  exportDriverBank: async (params) => {
    return await request.download({ url: `/base/driver-bank/export-excel`, params })
  }
}